package org.creativor.rayson.transport.server.transfer;

import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertTrue;
import org.creativor.rayson.api.TransferArgument;
import org.creativor.rayson.api.TransferService;
import org.creativor.rayson.api.TransferSocket;
import org.creativor.rayson.demo.proxy.DemoTransferArgument;
import org.creativor.rayson.demo.server.DemoTransferService;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;

/**
 * The class <code>TransferConnectorTest</code> contains tests for the class <code>{@link TransferConnector}</code>.
 * <p>
 * Copyright Creativor Studio (c) 2011
 *
 * @generatedBy CodePro at 11-5-7 下午3:25
 * @author Nick Zhang
 * @version $Revision: 1.0 $
 */
public class TransferConnectorTest {
	/**
	 * Run the TransferConnector(String) constructor test.
	 *
	 * @throws Exception
	 *
	 * @generatedBy CodePro at 11-5-7 下午3:25
	 */
	@Test
	public void testTransferConnector_1()
		throws Exception {
		String serverName = "";

		TransferConnector result = new TransferConnector(serverName);

		// TODO: add additional test code here
		assertNotNull(result);
	}

	/**
	 * Run the boolean isSupportedVersion(short,short) method test.
	 *
	 * @throws Exception
	 *
	 * @generatedBy CodePro at 11-5-7 下午3:25
	 */
	@Test
	public void testIsSupportedVersion_1()
		throws Exception {
		TransferConnector fixture = new TransferConnector("");
		short transferCode = (short) 1;
		short clientVersion = (short) 1;

		boolean result = fixture.isSupportedVersion(transferCode, clientVersion);

		// TODO: add additional test code here
		// An unexpected exception was thrown in user code while executing this test:
		//    java.lang.NullPointerException
		//       at org.creativor.rayson.transport.server.transfer.TransferConnector.isSupportedVersion(TransferConnector.java:139)
		assertTrue(result);
	}

	/**
	 * Run the boolean isSupportedVersion(short,short) method test.
	 *
	 * @throws Exception
	 *
	 * @generatedBy CodePro at 11-5-7 下午3:25
	 */
	@Test
	public void testIsSupportedVersion_2()
		throws Exception {
		TransferConnector fixture = new TransferConnector("");
		short transferCode = (short) 1;
		short clientVersion = (short) 1;

		boolean result = fixture.isSupportedVersion(transferCode, clientVersion);

		// TODO: add additional test code here
		// An unexpected exception was thrown in user code while executing this test:
		//    java.lang.NullPointerException
		//       at org.creativor.rayson.transport.server.transfer.TransferConnector.isSupportedVersion(TransferConnector.java:139)
		assertTrue(result);
	}

	/**
	 * Run the void registerService(TransferService) method test.
	 *
	 * @throws Exception
	 *
	 * @generatedBy CodePro at 11-5-7 下午3:25
	 */
	@Test
	public void testRegisterService_1()
		throws Exception {
		TransferConnector fixture = new TransferConnector("");
		TransferService service = new DemoTransferService();

		fixture.registerService(service);

		// TODO: add additional test code here
	}

	/**
	 * Run the void registerService(TransferService) method test.
	 *
	 * @throws Exception
	 *
	 * @generatedBy CodePro at 11-5-7 下午3:25
	 */
	@Test
	public void testRegisterService_2()
		throws Exception {
		TransferConnector fixture = new TransferConnector("");
		TransferService service = new DemoTransferService();

		fixture.registerService(service);

		// TODO: add additional test code here
	}

	/**
	 * Run the void registerService(TransferService) method test.
	 *
	 * @throws Exception
	 *
	 * @generatedBy CodePro at 11-5-7 下午3:25
	 */
	@Test(expected = org.creativor.rayson.exception.IllegalServiceException.class)
	public void testRegisterService_3()
		throws Exception {
		TransferConnector fixture = new TransferConnector("");
		TransferService service = null;

		fixture.registerService(service);

		// TODO: add additional test code here
	}

	/**
	 * Run the boolean serviceExists(short) method test.
	 *
	 * @throws Exception
	 *
	 * @generatedBy CodePro at 11-5-7 下午3:25
	 */
	@Test
	public void testServiceExists_1()
		throws Exception {
		TransferConnector fixture = new TransferConnector("");
		short transferCode = (short) 1;

		boolean result = fixture.serviceExists(transferCode);

		// TODO: add additional test code here
		assertEquals(false, result);
	}

	/**
	 * Run the boolean serviceExists(short) method test.
	 *
	 * @throws Exception
	 *
	 * @generatedBy CodePro at 11-5-7 下午3:25
	 */
	@Test
	public void testServiceExists_2()
		throws Exception {
		TransferConnector fixture = new TransferConnector("");
		short transferCode = (short) 1;

		boolean result = fixture.serviceExists(transferCode);

		// TODO: add additional test code here
		assertEquals(false, result);
	}

	/**
	 * Run the void start() method test.
	 *
	 * @throws Exception
	 *
	 * @generatedBy CodePro at 11-5-7 下午3:25
	 */
	@Test
	public void testStart_1()
		throws Exception {
		TransferConnector fixture = new TransferConnector("");

		fixture.start();

		// TODO: add additional test code here
	}

	/**
	 * Run the void start() method test.
	 *
	 * @throws Exception
	 *
	 * @generatedBy CodePro at 11-5-7 下午3:25
	 */
	@Test
	public void testStart_2()
		throws Exception {
		TransferConnector fixture = new TransferConnector("");

		fixture.start();

		// TODO: add additional test code here
	}

	/**
	 * Run the void stop() method test.
	 *
	 * @throws Exception
	 *
	 * @generatedBy CodePro at 11-5-7 下午3:25
	 */
	@Test
	public void testStop_1()
		throws Exception {
		TransferConnector fixture = new TransferConnector("");

		fixture.stop();

		// TODO: add additional test code here
	}

	/**
	 * Run the void stop() method test.
	 *
	 * @throws Exception
	 *
	 * @generatedBy CodePro at 11-5-7 下午3:25
	 */
	@Test
	public void testStop_2()
		throws Exception {
		TransferConnector fixture = new TransferConnector("");

		fixture.stop();

		// TODO: add additional test code here
	}

	/**
	 * Run the void submitCall(short,TransferArgument,TransferSocket) method test.
	 *
	 * @throws Exception
	 *
	 * @generatedBy CodePro at 11-5-7 下午3:25
	 */
	@Test(expected = org.creativor.rayson.transport.server.transfer.TransferCallException.class)
	public void testSubmitCall_1()
		throws Exception {
		TransferConnector fixture = new TransferConnector("");
		short transfer = (short) 1;
		TransferArgument argument = new DemoTransferArgument("");
		TransferSocket socket = null;

		fixture.submitCall(transfer, argument, socket);

		// TODO: add additional test code here
	}

	/**
	 * Run the void submitCall(short,TransferArgument,TransferSocket) method test.
	 *
	 * @throws Exception
	 *
	 * @generatedBy CodePro at 11-5-7 下午3:25
	 */
	@Test(expected = org.creativor.rayson.transport.server.transfer.TransferCallException.class)
	public void testSubmitCall_2()
		throws Exception {
		TransferConnector fixture = new TransferConnector("");
		short transfer = (short) 1;
		TransferArgument argument = new DemoTransferArgument("");
		TransferSocket socket = null;

		fixture.submitCall(transfer, argument, socket);

		// TODO: add additional test code here
	}

	/**
	 * Run the void submitCall(short,TransferArgument,TransferSocket) method test.
	 *
	 * @throws Exception
	 *
	 * @generatedBy CodePro at 11-5-7 下午3:25
	 */
	@Test(expected = org.creativor.rayson.transport.server.transfer.TransferCallException.class)
	public void testSubmitCall_3()
		throws Exception {
		TransferConnector fixture = new TransferConnector("");
		short transfer = (short) 1;
		TransferArgument argument = new DemoTransferArgument("");
		TransferSocket socket = null;

		fixture.submitCall(transfer, argument, socket);

		// TODO: add additional test code here
	}

	/**
	 * Perform pre-test initialization.
	 *
	 * @throws Exception
	 *         if the initialization fails for some reason
	 *
	 * @generatedBy CodePro at 11-5-7 下午3:25
	 */
	@Before
	public void setUp()
		throws Exception {
		// TODO: add additional set up code here
	}

	/**
	 * Perform post-test clean-up.
	 *
	 * @throws Exception
	 *         if the clean-up fails for some reason
	 *
	 * @generatedBy CodePro at 11-5-7 下午3:25
	 */
	@After
	public void tearDown()
		throws Exception {
		// TODO: add additional tear down code here
	}

	/**
	 * Launch the test.
	 *
	 * @param args the command line arguments
	 *
	 * @generatedBy CodePro at 11-5-7 下午3:25
	 */
	public static void main(String[] args) {
		new org.junit.runner.JUnitCore().run(TransferConnectorTest.class);
	}
}